import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {LoginComponent} from './login/login.component';
import {YourGuardGuard} from './guard/your-guard.guard';


const routes: Routes = [
  {path: 'login', component: LoginComponent},
  {path: '' , pathMatch: 'full', redirectTo: '/login'},
  { path: 'index', loadChildren: () => import('./index/index.module')
      .then(m => m.IndexModule), canActivate: [YourGuardGuard] },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
